<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/base.jsp"%>
<%
	String basepath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort() + "/";
    String appId=request.getParameter("a");
    String entrId=request.getParameter("e");
    String iosurl="itms-services://?action=download-manifest&url="+basepath+"WORKDIR/ENTERPRISE_"+entrId+"/"+appId+"/DLIST/universal_"+appId+".plist";
    String action=request.getParameter("action");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<script type="text/javascript" src="<%=path%>/manage/js/jquery-1.4.4.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function() {
				if(<%=action%>==1){
					$.get(root + '/produce/getLastIosDownUrl.action',{'appId': <%=appId%>},function(data){
				    	if(data=="")
				    		$("#errorMsg").html("获取地址错误，请稍后重试");
				    	else
				    		window.location.href = data;
				    });
				} else {
					window.location.href="<%=iosurl%>";
				}
			});
		</script>
	</head>
</html>
